Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pins.hal sets up hardware probe to signal 'probe'
- # Add a lowpass filter to probe signal when not in a probing move
- ###########################
- # Setup lowpass component #
- ###########################
- loadrt lowpass names=probe-lowpass
- addf probe-lowpass servo-thread
- # For a sampling period T (seconds),
- # the gain for this Hal lowpass component is:
- # gain = 1 - e^(-a * T)
- # Example:
- # T = 0.001 seconds (typical servo thread period)
- # a = (2*pi*100) (100Hz bandwith single pole)
- # gain = 0.466
- sets probe-lowpass.gain 0.466
- ################################
- # Setup motion-type comparator #
- ################################
- loadrt comp names=motion-eq-probing
- addf motion-eq-probing servo-thread
- # When probing motion.motion−type == 5
- setp motion-eq-probing.in0 5
- net motion-type motion-eq-probing.in1 <= motion.motion−type
- net disable-probe-lowpass motion-eq-probing.equal => probe-lowpass.load
- # Probe signal via lowpass component
- net probe => probe-lowpass.in
- net probe-filtered probe-lowpass.out => motion.probe-input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement